﻿using System;
using System.Threading.Tasks;

namespace UdpDemo
{
    class Program
    {
        static async Task Main(string[] args)
        {
            Console.WriteLine("UDP通信演示程序");
            Console.WriteLine("1. 启动UDP服务器 (监听50789端口)");
            Console.WriteLine("2. 启动UDP客户端 (发送数据到50789端口)");
            Console.Write("请选择: ");
            
            string choice = Console.ReadLine();
            
            if (choice == "1")
            {
                await UdpServer.RunServer();
            }
            else if (choice == "2")
            {
                await UdpClient.RunClient();
            }
            else
            {
                Console.WriteLine("无效选择");
            }
        }
    }
}